#include "refuelling_struct_csv.hpp"
#include "type_conversion.hpp"


refuelling_struct_csv::refuelling_struct_csv(std::vector<std::string> const& v)
{
		
	   switch(v.size()-1)
 	   {
		case NOTE: 
			set_notes(v[NOTE]);
		case FULL:
			set_full(type_conversion<int>::to_number(v[FULL]));
		case EMERGENCY_SUPPLY:
			set_emergencySupply(type_conversion<int>::to_number(v[EMERGENCY_SUPPLY]));
		case KM: 
			set_kilometers(type_conversion<float>::to_number(v[KM]));
		case PLATE_ID:
			set_plateId(type_conversion<int>::to_number(v[PLATE_ID]));
		case UNITARY_PRICE:
			set_unitaryCost(type_conversion<float>::to_number(v[UNITARY_PRICE]));
		case AMOUNT:
			set_totalAmount(type_conversion<float>::to_number(v[AMOUNT]));
		case DATE:	
			set_refuellingDate(date_input_string::to_date(v[DATE]));
		case ID:
			set_refuellingId(type_conversion<int>::to_number(v[ID]));
			break;
		default: break;
	   }
		
		std::cout << "[refuelling_struct_csv.refuelling_struct_csv] " << *this << std::endl;
}
